﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ST.Torch.WebApi.Core.Entities.System
{
    /*
    /// <summary>
    /// 角色-菜单 关联--配置成多对多了 不需要了
    /// </summary>
    public class SYSRoleMenu : BaseEntity, IEntityTypeBuilder<SYSRoleMenu>
    {
        public Guid RoleId { get; set; }
        public SYSRole Role { get; set; }
        public Guid MenuId { get; set; }
        public SYSMenu Menu { get; set; }
        public void Configure(EntityTypeBuilder<SYSRoleMenu> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            //entityBuilder.HasKey(u => u.Id);
            entityBuilder.HasKey(u => new { u.RoleId, u.MenuId });
            //entityBuilder.HasOne(u => u.Role).WithMany(u=>u.RoleMenus).HasForeignKey(u=>u.RoleId);  
            //entityBuilder.HasOne(u => u.Menu).WithMany(u=>u.RoleMenus).HasForeignKey(u=>u.MenuId);


        }
    }
    */
}
